package xuan.mall.system.interfaces.facade;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xuan.mall.system.application.service.MenuAppService;
import xuan.mall.system.domain.entity.Menu;
import xuan.mall.system.interfaces.dto.response.Response;

import java.util.List;

/**
 * @author: rongxuanzhou
 * @create: 2025/5/31
 * @Description:
 */
@RestController
@Tag(name = "菜单")
@RequestMapping("/menu")
@RequiredArgsConstructor
public class MenuController {

    private final MenuAppService menuAppService;

    @Operation(summary = "根据用户权限获取菜单")
    @GetMapping
    public Response<List<Menu>> getMenu() {
        return Response.success(menuAppService.getCurrentUserMenu());
    }
}
